$(function () {

    $("#addPullDown .btn-save").click(function () {
        var submissionKey = $("#submissionKey").val();
        if(submissionKey === null || submissionKey === ""){
            $MB.n_danger("请选择添加类型！");
            $('#addPullDown').modal('hide')
            return;
        }
        var submissionValue = $("#submissionValue").val();
        if(submissionValue === null || submissionValue === ""){
            $MB.n_danger("请填写添加内容！");
            $('#addPullDown').modal('hide')
            return;
        }
        var submissionRemakes = $("#submissionRemakes").val();

        var par = new Object()
        par.submissionKey = submissionKey;
        par.submissionValue = submissionValue;
        par.submissionRemakes = submissionRemakes;

        $.post(ctx+"submission/addPullDown",par,function (r) {
            if (r.code !== 0) {
                $MB.n_danger(r.msg);
                $('#card-read').modal('hide')
                return;
            }else{
                $MB.n_success("配置信息已提交！");
                // print(r);
                $('#card-read').modal('hide')
                console.log(r)
                return;
            }
        });
    });
    $("#addPullDown .btn-save").click(function () {
        closeModal();
    });
    $("#addPullDown .btn-close").click(function () {
        closeModal();
    });
    function closeModal() {
        $MB.closeAndRestModal("addPullDown");
        clearInfo();
    }
});